'use strict';
module.exports = {
	/**
	 * 获取资讯列表
	 * @url client/articles/pub/getNewsList 前端调用的url参数地址
	 * data 请求参数
	 * @param {String} params1  参数1
	 */
	main: async (event) => {
		let { data = {}, util, filterResponse, originalParam } = event;
		let { customUtil, uniID, config, pubFun, vk, db, _ } = util;
		let { pageNo, pageSize } = data;
		let res = { code: 0, msg: "" };
		// 业务逻辑开始-----------------------------------------------------------

		res = await vk.baseDao.selects({
			dbName: "opendb-news-articles",
			getMain: false, // 是否只返回rows数据
			pageIndex: pageNo, // 当前第几页
			pageSize: pageSize, // 每页条数
			fieldJson: { content: false },
			sortArr: [
				{ "name": "is_essence", "type": "desc" },
				{ "name": "publish_date", "type": "desc" },
			]
		});

		// 业务逻辑结束-----------------------------------------------------------
		return res;
	}
}
